<head>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
    <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
    <%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
    <script type="text/javascript"
            src="<%=request.getContextPath()%>/script/jquery.validate.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/script/questionnaire/main.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $("#deletedialog").click(function (){
                if (confirm("Are you sure you want to delete this dialog?")){
                    $.post('delete.html', {
                        id: ${dialog.questionnaireId}
                    },
                    function(data) {
                        if (data != ""){
                            if (data.indexOf(":true")>0){
                                data = data.replace(":true","");
                                window.location.href="list.html?checkSearch=list";
                                $('.error h3').html(data);
                            }else{
                                $('.message').html(data);
                            }
                        }else{
                            $('.message').html("error!");
                        }
                    });
                }else{
                    $('.message').html("Action cancelled");
                }
            });

            $("#previewBtn").click(function () {
                pov(${param.id});
            });
        });
    </script>
</head>
<!-- Menu -->
<jsp:include page="menu.jsp" />

<!--START: Subnav -->
<div class="sub_nav">
    <ul>
        <li>
            <a href="#"><img
                    src="<%=request.getContextPath()%>/images/menu/sub_general_on.gif"
                width="114" height="18" alt="gernal" /> </a>
        </li>
        <li>
            <a href="pages.html?id=${dialog.questionnaireId}"><img
                    src="<%=request.getContextPath()%>/images/menu/sub_pages_off.gif"
                width="114" height="18" alt="page" /> </a>
        </li>
    </ul>
</div>
<!--END: Subnav -->

<!--START: content -->
<div class="content2">
    <div class="insider">
        <div class="corners">
            <div class="corners_top"></div>
            <form id="dialog" method="post">
                <input type="hidden" id="submitAction" name="submitAction" />
                <div class="column1">
                    <div class="col_l">
                        <table width="440" border="0" cellspacing="4"
                               class="formlayout_table">
                            <tr>
                                <th width="188">
                                    <label>
                                        ID:
                                    </label>
                                </th>
                                <td width="240">
                                    ${dialog.refId}
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Version:
                                    </label>
                                </th>
                                <td>
                                    ${dialog.version}
                                </td>
                            </tr>
                             <tr>
                                <th>
                                    <label>
                                        Name:
                                    </label>
                                </th>
                                <td>
                                    ${dialog.name}
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Vocabulary Name:
                                    </label>
                                </th>
                                <td>
                                    ${dialog.vocabularyname}
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Display Title:
                                    </label>
                                </th>
                                <td>
                                    ${dialog.displayTitle}
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Description:
                                    </label>
                                </th>
                                <td>
                                    ${dialog.description}
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Function:
                                    </label>
                                </th>
                                <td>${function}
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Region:
                                    </label>
                                </th>
                                <td>${region}
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Product Line:
                                    </label>
                                </th>
                                <td>${productType}
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Locale:
                                    </label>
                                </th>
                                <td>${locale}
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Theme:
                                    </label>
                                </th>
                                <td>${theme}
                                </td>
                            </tr>
                            <tr>
					            <th>
					                <label>
					                    Enable Save:
					                </label>
					            </th>
					            <td>
					                <c:if test="${dialog.enableSave}">
					                    Yes
					                </c:if>
					                <c:if test="${not dialog.enableSave}">
					                    No
					                </c:if>
					            </td>
					        </tr>
                            <tr>
                                <th>
                                    <label>
                                        Summary Report:
                                    </label>
                                </th>
                                <td>
                                    <c:if test="${dialog.summaryReport == true}">Yes</c:if>
                                    <c:if test="${dialog.summaryReport == false}">No</c:if>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Decision Service Name:
                                    </label>
                                </th>
                                <td><div class="pr"><span style="position:absolute;left:0;top:0;word-break:normal;">${dialog.decisionServiceName}</span></div>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Decision Service Version:
                                    </label>
                                </th>
                                <td>${dialog.decisionServiceVersion}
                                </td>
                            </tr>
                            <tr>
							    <th>
							        <label>
							            Exit Page Url:
							        </label>
							    </th>
							    <td class="bg_n">
							        ${dialog.exitpageurl}
							    </td>
							</tr>
                        </table>
                    </div>
                    <table width="283" border="0" cellspacing="4"
                           class="formlayout_table fr">
                        <tr>
                            <th width="159">
                                <label>
                                    Sibling ID:
                                </label>
                            </th>
                            <td width="111">${dialog.sibling.refId}
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <label>
                                    Sibling Version:
                                </label>
                            </th>
                            <td>${dialog.sibling.version}
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <label>
                                    Publication Status:
                                </label>
                            </th>
                            <td>
                                ${dialog.publicationStatus.name}
                            </td>
                        </tr>

                        <tr>
                            <th width="159">
                                <label>
                                    Last Modified Date:
                                </label>
                            </th>
                            <td width="111"><fmt:formatDate value="${dialog.modifiedOn}" pattern="dd-MMM-yyyy" /></td>
                        </tr>
                        <tr>
                            <th>
                                <label>
                                    Last Modified By:
                                </label>
                            </th>
                            <td>${dialog.modifiedBy.username}</td>
                        </tr>

                        <tr>
                            <th>
                                <label>
                                    Published Date:
                                </label>
                            </th>
                            <td>
                                <fmt:formatDate value="${dialog.publishedOn}" pattern="dd-MMM-yyyy" />
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <label>
                                    Published By:
                                </label>
                            </th>
                            <td>
                                ${dialog.publishedBy.username}
                            </td>
                        </tr><tr>
                            <th>
                                <label>
                                    Effective Date:
                                </label>
                            </th>
                            <td>
                                <fmt:formatDate value="${dialog.effectiveDate}" pattern="dd-MMM-yyyy" />
                            </td>
                        </tr><tr>
                            <th>
                                <label>
                                    End Date:
                                </label>
                            </th>
                            <td>
                                <fmt:formatDate value="${dialog.expirationDate}" pattern="dd-MMM-yyyy" />
                            </td>
                        </tr><tr>
                            <th>
                                <label>
                                    Publish Notes:
                                </label>
                            </th>
                            <td>
                                ${dialog.publishText}
                            </td>
                        </tr>

                        <tr>
                            <th>
                                <label>
                                    Retired By:
                                </label>
                            </th>
                            <td>
                                ${dialog.retiredBy.username}
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <label>
                                    Retire Date:
                                </label>
                            </th>
                            <td><fmt:formatDate value="${dialog.retiredOn}" pattern="dd-MMM-yyyy" />
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <label>
                                    Retire Notes:
                                </label>
                            </th>
                            <td>
                                ${dialog.retiredNote}
                            </td>
                        </tr>
                    </table>
                </div>
                <ul class="functions1">
                    <li>

                        <a href="list.html?checkSearch=list">
                            <img width="122" height="23" class="btn" src="<%= request.getContextPath()%>/images/btn/functions1/back_to_results.gif"/>
                        </a>

                    </li>
                    <security:authorize ifAnyGranted="ROLE_PORTAL_USER, ROLE_AUTHOR">
                        <c:if test="${dialog.publicationStatus.code=='inprocess'}">
                            <li><a href="newversion.html?id=${dialog.questionnaireId}" id="newversiondialog"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_new_version.gif" width="122" height="23" class="btn" /></a></li>
                            <li><a href="edit.html?id=${dialog.questionnaireId}" id="editdialog"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_edit.gif" width="122" height="23" class="btn" /></a></li>
                        </c:if>
                        <c:if test="${dialog.publicationStatus.code=='retired'}">
                            <li><a href="#"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_new_version_tint.gif" width="122" height="23"/></a></li>
                            <li><a href="#"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_edit_tint.gif" width="122" height="23"/></a></li>
                        </c:if>
                        <c:if test="${dialog.publicationStatus.code=='published'}">
                            <li><a href="newversion.html?id=${dialog.questionnaireId}" id="newversiondialog"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_new_version.gif" width="122" height="23" class="btn" /></a></li>
                            <li><a href="#"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_edit_tint.gif" width="122" height="23"/></a></li>
                        </c:if>
                        <li><a href="copy.html?id=${dialog.questionnaireId}"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_copy.gif" alt="" width="122" height="23" class="btn" /></a></li>
                        <c:if test="${dialog.publicationStatus.code=='published' || dialog.publicationStatus.code=='retired' }">
                            <li><a href="#"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_delete_tint.gif" alt="delete dialog" width="122" height="23"/></a></li>
                        </c:if>
                        <c:if test="${dialog.publicationStatus.code=='inprocess'}">
                            <li><a href="#" id="deletedialog"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_delete.gif" alt="delete dialog" width="122" height="23" class="btn" /></a></li>
                        </c:if>


                        <li><a href="replicate.html?id=${dialog.questionnaireId}" id="replicatedialog"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_replicate.gif" alt="replicate dialog" width="122" height="23" class="btn" /></a></li>
                    </security:authorize>
                    <security:authorize ifAnyGranted="ROLE_PORTAL_USER, ROLE_REVIEWER">
                        <c:if test="${dialog.publicationStatus.code=='retired'}">
                            <li><a href="#"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_retire_tint.gif" alt="" width="122" height="23" /></a></li>
                        </c:if>
                        <c:if test="${dialog.publicationStatus.code!='retired'}">
                            <li><a href="retire.html?id=${dialog.questionnaireId}"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_retire.gif" alt="" width="122" height="23" class="btn" /></a></li>
                        </c:if>
                        <c:if test="${dialog.publicationStatus.code=='retired' ||  dialog.publicationStatus.code=='published'}">
                            <li><a href="#"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_publish_tint.gif" alt="public dialogs" width="122" height="23" /></a></li>
                        </c:if>
                        <c:if test="${dialog.publicationStatus.code!='retired' && dialog.publicationStatus.code!='published'}">
                            <li><a href="publish.html?id=${dialog.questionnaireId}"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_publish.gif" alt="public dialogs" width="122" height="23" class="btn" /></a></li>
                        </c:if>
                    </security:authorize>
                    <security:authorize ifAnyGranted="ROLE_PORTAL_USER, ROLE_AUTHOR">
                        <li>
                            <a href="#" id="previewBtn">
                                <img src="<%= request.getContextPath()%>/images/btn/functions1/btn_preview.gif"
                                     class="btn" />
                            </a>
                        </li>
                         <li>
                            <a href="#" id="exportXMI">
                                <a href="exportxmi.html?id=${dialog.questionnaireId}"><img src="<%= request.getContextPath()%>/images/btn/functions1/btn_generate_xmi.gif"
                                     class="btn" /></a>
                            </a>
                        </li>
                    </security:authorize>
                </ul>
                <div class="corners_bottom"></div>
            </form>
        </div>
        <div class="message">
            ${message}
            <h3>
                <style> p { margin:0px }</style>
                <font color="red">
                    <p id="Msg_Retire" style="display:none;">${Msg_Retire}</p>
                </font>
            </h3>
        </div>
    </div>
</div>
<!--END: content -->

<!--START: Footer -->
<div class="footer"></div>
<!--END: Footer -->

<jsp:include page="previewFrame.jsp" />